home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
626-637
/
disk_629
/
apig
/
apig31.lzh
/
e7_images2.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-09-27
|
3KB
|
89 lines
/* same as e7_images.rexx, but the Image is hard-coded */
x = addlib("apig.library",0,-30,0)
call set_apig_globals()
portname = "example7i2_port"
p = openport(portname)
call set_apig_globals()
scrtitle = "Hey Buddy, Yea You, This is Your New Screen !"
wintitle = "This is your title"
winidcmp = CLOSEWINDOW
winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
scr = openscreen(0,0,640,400,3,4,5,LACE+HIRES,CUSTOMSCREEN,scrtitle)
/* open window */
w1 = openwindow(portname,0,0,640,400,2,4,winidcmp,winflags,wintitle,scr,0,0,0)
rpw1 = getwindowrastport(w1)
call hardcodeimage()
x = drawimage(rpw1,image,270,90)
z = pitext(rpw1,200,112,"This is small a IFF image",1,2,JAM2,0,0)
wait 2 secs
z = clearscreen(rpw1,0,0)
do x = 10 to 600 by 50
do y = 10 to 380 by 16
z = drawimage(rpw1,image,x,y)
end
end
wait 1 secs
z = pitext(rpw1,250,112,"Im DONE ...",1,2,JAM2,0,0)
z = pitext(rpw1,180,122,"You Can Close The Window Now",1,2,JAM2,0,0)
exitme = 0
do forever
x = waitpkt(portname)
do forever
msg = getpkt(portname)
if msg = '0000 0000'x then leave
class = getarg(msg,0)
if class = CLOSEWINDOW then exitme = 1
x = reply(msg,0)
end
if exitme = 1 then leave
end
x = freeimage(image)
say " image mem freed = " x
a =closewindow(w1)
a =closescreen(scr)
exit
hardcodeimage: /* hard code a check mark image */
/* makestruct & makepointer are the same function, */
/* I like the names for readability */
image = makestruct(0,51,0,MEMF_CLEAR)
imagedata = makepointer(image,0,72,MEMF_CHIP)
x = setvalue(image,0,2,'n',0,0) /* left edge */
x = setvalue(image,2,2,'n',0,0) /* top edge */
x = setvalue(image,4,2,'n',16,0) /* width */
x = setvalue(image,6,2,'n',9,0) /* height */
x = setvalue(image,8,2,'n',4,0) /* depth */
x = setvalue(image,10,4,'p',imagedata,0) /* imagedata */
x = setvalue(image,14,1,'n',255,0) /* planepick */
x = setvalue(image,15,1,'n',255,0) /* planeonoff */
x = setvalue(image,16,4,'p',0,0) /* next image */
call export(imagedata,('0000'x ||'0003'x ||'0033'x ||'0063'x ||'0CC3'x ||'0783'x,
|| '0303'x ||'0003'x ||'FFFF'x ||'FFFF'x ||'C000'x ||'C030'x ||'C060'x ||'CCC0'x,
|| 'C780'x ||'C300'x ||'C000'x ||'0000'x ||'FFFF'x ||'FFFF'x ||'FFFF'x ||'FFFF'x,
|| 'FFFF'x ||'FFFF'x ||'FFFF'x ||'FFFF'x ||'FFFF'x ||'0000'x ||'0000'x ||'0000'x,
|| '0000'x ||'0000'x ||'0000'x ||'0000'x ||'0000'x ||'0000'x),72)
return 1